import 'dart:async';

import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:gourmet/color/hex.dart';
import 'package:gourmet/route/index.dart';
import 'package:gourmet/ui/draw_top_line.dart';
import 'package:gourmet/ui/draw_under_line.dart';
import 'package:gourmet/utils/colors.dart';
import 'package:gourmet/utils/radian.dart';
import 'package:gourmet/utils/styles.dart';
import 'package:gourmet/utils/svg.dart';

class ShopCartSubmitController extends GetxController {
  RxBool isSelected = RxBool(true);

  RxBool isAgree = RxBool(false);

  RxInt typeIndex = RxInt(0);

  RxInt second = RxInt(541);

  late Timer timer;

  @override
  void onInit() {
    timer = Timer.periodic(const Duration(seconds: 1), (_) {
      if (second.value > 0) {
        second--;
        return;
      }
      timer.cancel();
    });
    super.onInit();
  }

  @override
  void onClose() {
    if (timer.isActive) {
      timer.cancel();
    }
    super.onClose();
  }
}

class ShopCartSubmitPage extends GetView<ShopCartSubmitController> {
  const ShopCartSubmitPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Stack(
        children: [
          Container(
            //linear-gradient(180deg, rgba(255, 153, 0, 1) 0%, rgba(255, 153, 0, 1) 0%, rgba(255, 100, 77, 1) 17%, rgba(245, 245, 245, 1) 35%, rgba(245, 245, 245, 1) 100%)
            decoration: BoxDecoration(
                gradient: LinearGradient(
                    colors: [
                      ColorsUtils.rgba(255, 153, 0, 1),
                      ColorsUtils.rgba(255, 153, 0, 1),
                      ColorsUtils.rgba(255, 100, 77, 1),
                      ColorsUtils.rgba(245, 245, 245, 1),
                      ColorsUtils.rgba(245, 245, 245, 1)
                    ],
                    begin: const Alignment(0, 1),
                    end: const Alignment(0, -1),
                    stops: const [0.0, 0.0, 0.17, 0.35, 1.0],
                    tileMode: TileMode.mirror,
                    transform:
                        GradientRotation(RadianUtils.angleToRadian(180)))),
            child: CustomScrollView(
              physics: const NeverScrollableScrollPhysics(),
              slivers: [
                MediaQuery.removePadding(
                  context: context,
                  removeBottom: true,
                  removeLeft: true,
                  removeRight: true,
                  child: SliverAppBar(
                    backgroundColor: Colors.transparent,
                    systemOverlayStyle: SystemUiOverlayStyle.light,
                    leading: IconButton(
                        onPressed: Get.back,
                        icon: const Icon(
                          CupertinoIcons.chevron_back,
                          size: 18,
                          color: Colors.white,
                        )),
                    pinned: true,
                    centerTitle: true,
                    title: Text(
                      '提交订单',
                      softWrap: true,
                      style: StylesUtils.customTextStyle(
                          fontWeight: FontWeight.w700,
                          fontSize: StylesUtils.fontSize16),
                    ),
                    bottom: PreferredSize(
                      preferredSize: const Size.fromHeight(50),
                      child: Center(
                        child: Container(
                          height: 40,
                          width: 345,
                          padding: const EdgeInsets.symmetric(horizontal: 10),
                          decoration: BoxDecoration(
                              color: HexColor(ColorsUtils.colorFff9),
                              borderRadius: BorderRadius.circular(10)),
                          child: Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            children: [
                              Icon(
                                CupertinoIcons.speaker_2_fill,
                                size: 18,
                                color: HexColor(ColorsUtils.colorF660),
                              ),
                              Expanded(
                                  child: Container(
                                padding: const EdgeInsets.only(left: 10),
                                alignment: Alignment.centerLeft,
                                child: Text(
                                  '请注意，因恶劣天气配送费上调！',
                                  style: StylesUtils.customTextStyle(
                                      fontSize: StylesUtils.fontSize13,
                                      color: ColorsUtils.colorF660),
                                ),
                              )),
                              Icon(
                                CupertinoIcons.multiply,
                                size: 18,
                                color: HexColor(ColorsUtils.color9999),
                              )
                            ],
                          ),
                        ),
                      ),
                    ),
                  ),
                ),
                SliverFillRemaining(
                  hasScrollBody: true,
                  fillOverscroll: false,
                  child: MediaQuery.removeViewPadding(
                    context: context,
                    removeLeft: true,
                    removeBottom: true,
                    removeRight: true,
                    removeTop: true,
                    child: ListView(children: [
                      Center(
                        child: Obx(() => Container(
                              margin: const EdgeInsets.only(top: 10),
                              height: controller.isSelected.isTrue ? 220 : 240,
                              width: 345,
                              child: Column(
                                children: [
                                  SizedBox(
                                    height: 50,
                                    child: Row(
                                      children: [
                                        Expanded(
                                          child: GestureDetector(
                                            onTap: () {
                                              controller.isSelected.value =
                                                  true;
                                            },
                                            child: Obx(() {
                                              if (controller
                                                  .isSelected.isTrue) {
                                                return Container(
                                                  padding:
                                                      const EdgeInsets.only(
                                                          top: 10),
                                                  decoration: const BoxDecoration(
                                                      color: Colors.white,
                                                      borderRadius:
                                                          BorderRadius.only(
                                                              topLeft: Radius
                                                                  .circular(10),
                                                              topRight: Radius
                                                                  .circular(
                                                                      10))),
                                                  alignment: Alignment.center,
                                                  child: Text(
                                                    '配送外卖',
                                                    softWrap: true,
                                                    style: StylesUtils
                                                        .customTextStyle(
                                                            fontWeight:
                                                                FontWeight.w700,
                                                            color: ColorsUtils
                                                                .colorFf64,
                                                            fontSize: StylesUtils
                                                                .fontSize16),
                                                  ),
                                                );
                                              }
                                              return Container(
                                                margin: const EdgeInsets.only(
                                                    top: 10),
                                                decoration: BoxDecoration(
                                                  color: HexColor(
                                                      ColorsUtils.colorF9f9),
                                                  borderRadius:
                                                      const BorderRadius.only(
                                                          topLeft:
                                                              Radius.circular(
                                                                  10)),
                                                ),
                                                alignment: Alignment.center,
                                                child: Text(
                                                  '配送外卖',
                                                  softWrap: true,
                                                  style: StylesUtils
                                                      .customTextStyle(
                                                          color: ColorsUtils
                                                              .color0000,
                                                          fontSize: StylesUtils
                                                              .fontSize13,
                                                          fontWeight:
                                                              FontWeight.w700),
                                                ),
                                              );
                                            }),
                                          ),
                                        ),
                                        Expanded(
                                            child: GestureDetector(
                                          onTap: () {
                                            controller.isSelected.value = false;
                                          },
                                          child: Obx(() {
                                            if (controller.isSelected.isTrue) {
                                              return Container(
                                                margin: const EdgeInsets.only(
                                                    top: 10),
                                                decoration: BoxDecoration(
                                                  color: HexColor(
                                                      ColorsUtils.colorF9f9),
                                                  borderRadius:
                                                      const BorderRadius.only(
                                                          topRight:
                                                              Radius.circular(
                                                                  10)),
                                                ),
                                                alignment: Alignment.center,
                                                child: Text(
                                                  '到店自取',
                                                  softWrap: true,
                                                  style: StylesUtils
                                                      .customTextStyle(
                                                          color: ColorsUtils
                                                              .color0000,
                                                          fontSize: StylesUtils
                                                              .fontSize13,
                                                          fontWeight:
                                                              FontWeight.w700),
                                                ),
                                              );
                                            }
                                            return Container(
                                              padding: const EdgeInsets.only(
                                                  top: 10),
                                              decoration: const BoxDecoration(
                                                color: Colors.white,
                                                borderRadius: BorderRadius.only(
                                                    topLeft:
                                                        Radius.circular(10),
                                                    topRight:
                                                        Radius.circular(10)),
                                              ),
                                              alignment: Alignment.center,
                                              child: Text(
                                                '到店自取',
                                                softWrap: true,
                                                style:
                                                    StylesUtils.customTextStyle(
                                                        color: ColorsUtils
                                                            .colorFf64,
                                                        fontSize: StylesUtils
                                                            .fontSize16,
                                                        fontWeight:
                                                            FontWeight.w700),
                                              ),
                                            );
                                          }),
                                        ))
                                      ],
                                    ),
                                  ),
                                  Expanded(child: Obx(() => change))
                                ],
                              ),
                            )),
                      ),
                      Container(
                        margin: const EdgeInsets.only(top: 10),
                        alignment: Alignment.center,
                        child: Container(
                          padding: const EdgeInsets.all(15),
                          constraints: const BoxConstraints.expand(
                              width: 345, height: 205),
                          decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(10),
                              color: Colors.white),
                          child: Column(
                            children: [
                              Align(
                                alignment: Alignment.centerLeft,
                                child: Text(
                                  '华莱士-凤凰广场2店',
                                  softWrap: true,
                                  style: StylesUtils.customTextStyle(
                                      fontSize: StylesUtils.fontSize15,
                                      color: ColorsUtils.color0000),
                                ),
                              ),
                              Padding(
                                padding:
                                    const EdgeInsets.symmetric(vertical: 15),
                                child: Row(
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  children: [
                                    ClipRRect(
                                      borderRadius: BorderRadius.circular(5),
                                      child: Image.network(
                                        'https://img1.baidu.com/it/u=1225488377,644927263&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
                                        width: 60,
                                        height: 60,
                                        fit: BoxFit.fill,
                                      ),
                                    ),
                                    Expanded(
                                        child: Padding(
                                      padding: const EdgeInsets.only(left: 10),
                                      child: Column(
                                        children: [
                                          Row(
                                            mainAxisAlignment:
                                                MainAxisAlignment.spaceBetween,
                                            children: [
                                              Text(
                                                '香辣鸡块汉堡包',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                        color: ColorsUtils
                                                            .color0000,
                                                        fontSize: StylesUtils
                                                            .fontSize16,
                                                        fontWeight:
                                                            FontWeight.w700),
                                              ),
                                              Text.rich(TextSpan(children: [
                                                TextSpan(
                                                    text: '￥30',
                                                    style: StylesUtils.customTextStyle(
                                                        color: ColorsUtils
                                                            .color9999,
                                                        fontSize: StylesUtils
                                                            .fontSize16,
                                                        decoration:
                                                            TextDecoration
                                                                .lineThrough,
                                                        decorationColor:
                                                            HexColor(ColorsUtils
                                                                .color9999),
                                                        decorationStyle:
                                                            TextDecorationStyle
                                                                .solid,
                                                        decorationThickness:
                                                            1.0)),
                                                TextSpan(
                                                    text: '  ￥25',
                                                    style: StylesUtils
                                                        .customTextStyle(
                                                            color: ColorsUtils
                                                                .color0000,
                                                            fontSize:
                                                                StylesUtils
                                                                    .fontSize16,
                                                            fontWeight:
                                                                FontWeight
                                                                    .w700))
                                              ]))
                                            ],
                                          ),
                                          Container(
                                            margin:
                                                const EdgeInsets.only(top: 20),
                                            alignment: Alignment.centerLeft,
                                            child: Text(
                                              'x1',
                                              softWrap: true,
                                              style:
                                                  StylesUtils.customTextStyle(
                                                      fontSize: StylesUtils
                                                          .fontSize16,
                                                      color: ColorsUtils
                                                          .color0000),
                                            ),
                                          )
                                        ],
                                      ),
                                    ))
                                  ],
                                ),
                              ),
                              Row(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                mainAxisAlignment: MainAxisAlignment.start,
                                children: [
                                  ClipRRect(
                                    borderRadius: BorderRadius.circular(5),
                                    child: Image.network(
                                      'https://img1.baidu.com/it/u=2842303182,933026501&fm=253&fmt=auto&app=138&f=PNG?w=500&h=449',
                                      width: 60,
                                      height: 60,
                                      fit: BoxFit.fill,
                                    ),
                                  ),
                                  Expanded(
                                      child: Padding(
                                    padding: const EdgeInsets.only(left: 10),
                                    child: Column(
                                      children: [
                                        Row(
                                          mainAxisAlignment:
                                              MainAxisAlignment.spaceBetween,
                                          children: [
                                            Text(
                                              '百世可乐（中杯）',
                                              style:
                                                  StylesUtils.customTextStyle(
                                                      color:
                                                          ColorsUtils.color0000,
                                                      fontSize: StylesUtils
                                                          .fontSize16,
                                                      fontWeight:
                                                          FontWeight.w700),
                                            ),
                                            Text.rich(TextSpan(children: [
                                              TextSpan(
                                                  text: '￥8',
                                                  style: StylesUtils
                                                      .customTextStyle(
                                                          color: ColorsUtils
                                                              .color0000,
                                                          fontSize: StylesUtils
                                                              .fontSize16,
                                                          fontWeight:
                                                              FontWeight.w700))
                                            ]))
                                          ],
                                        ),
                                        Container(
                                          margin:
                                              const EdgeInsets.only(top: 20),
                                          alignment: Alignment.centerLeft,
                                          child: Text(
                                            'x1',
                                            softWrap: true,
                                            style: StylesUtils.customTextStyle(
                                                fontSize:
                                                    StylesUtils.fontSize16,
                                                color: ColorsUtils.color0000),
                                          ),
                                        )
                                      ],
                                    ),
                                  ))
                                ],
                              ),
                            ],
                          ),
                        ),
                      ),
                      Container(
                        margin: const EdgeInsets.only(top: 10),
                        alignment: Alignment.center,
                        child: Container(
                          width: 345,
                          padding: const EdgeInsets.only(
                              top: 10, right: 15, left: 15, bottom: 10),
                          decoration: BoxDecoration(
                              color: Colors.white,
                              borderRadius: BorderRadius.circular(10)),
                          child: Column(
                            children: [
                              SizedBox.fromSize(
                                size: const Size.fromHeight(45),
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text(
                                      '商品总价',
                                      style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.color0000,
                                          fontSize: StylesUtils.fontSize15),
                                    ),
                                    Text(
                                      '￥33',
                                      style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.color0000,
                                          fontSize: StylesUtils.fontSize15,
                                          fontWeight: FontWeight.w700),
                                    )
                                  ],
                                ),
                              ),
                              SizedBox.fromSize(
                                size: const Size.fromHeight(45),
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text(
                                      '打包费用',
                                      style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.color0000,
                                          fontSize: StylesUtils.fontSize15),
                                    ),
                                    Text(
                                      '￥2',
                                      style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.color0000,
                                          fontSize: StylesUtils.fontSize15,
                                          fontWeight: FontWeight.w700),
                                    )
                                  ],
                                ),
                              ),
                              SizedBox.fromSize(
                                size: const Size.fromHeight(45),
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text.rich(TextSpan(children: [
                                      TextSpan(
                                        text: '配送费用 ',
                                        style: StylesUtils.customTextStyle(
                                            color: ColorsUtils.color0000,
                                            fontSize: StylesUtils.fontSize15),
                                      ),
                                      WidgetSpan(
                                          child: Icon(
                                            CupertinoIcons.question_circle,
                                            color:
                                                HexColor(ColorsUtils.color9999),
                                            size: 14,
                                          ),
                                          alignment:
                                              PlaceholderAlignment.middle)
                                    ])),
                                    Text(
                                      '￥43',
                                      style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.color0000,
                                          fontSize: StylesUtils.fontSize15,
                                          fontWeight: FontWeight.w700),
                                    )
                                  ],
                                ),
                              ),
                              SizedBox.fromSize(
                                size: const Size.fromHeight(45),
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text(
                                      '配送附加费',
                                      style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.color0000,
                                          fontSize: StylesUtils.fontSize15),
                                    ),
                                    Text(
                                      '￥2',
                                      style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.color0000,
                                          fontSize: StylesUtils.fontSize15,
                                          fontWeight: FontWeight.w700),
                                    )
                                  ],
                                ),
                              ),
                              SizedBox.fromSize(
                                size: const Size.fromHeight(45),
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text.rich(TextSpan(children: [
                                      WidgetSpan(
                                          child: Container(
                                            constraints:
                                                const BoxConstraints.expand(
                                                    width: 16, height: 16),
                                            alignment: Alignment.center,
                                            decoration: BoxDecoration(
                                                borderRadius:
                                                    BorderRadius.circular(2),
                                                gradient: LinearGradient(
                                                    colors: [
                                                      // linear-gradient(90deg, rgba(255, 110, 83, 1) 0%, rgba(255, 110, 83, 1) 0%, rgba(255, 84, 53, 1) 100%, rgba(255, 84, 53, 1) 100%)
                                                      ColorsUtils.rgba(
                                                          255, 110, 83, 1),
                                                      ColorsUtils.rgba(
                                                          255, 110, 83, 1),
                                                      ColorsUtils.rgba(
                                                          255, 84, 53, 1),
                                                      ColorsUtils.rgba(
                                                          255, 84, 53, 1)
                                                    ],
                                                    stops: const [
                                                      0,
                                                      0,
                                                      1,
                                                      1
                                                    ],
                                                    begin: Alignment.topCenter,
                                                    end: Alignment.bottomCenter,
                                                    transform: GradientRotation(
                                                        RadianUtils
                                                            .angleToRadian(
                                                                90)))),
                                            child: Text(
                                              '减',
                                              style:
                                                  StylesUtils.customTextStyle(
                                                      fontSize: StylesUtils
                                                          .fontSize11),
                                            ),
                                          ),
                                          alignment:
                                              PlaceholderAlignment.middle),
                                      TextSpan(
                                        text: ' 新人立减',
                                        style: StylesUtils.customTextStyle(
                                            color: ColorsUtils.color0000,
                                            fontSize: StylesUtils.fontSize15),
                                      )
                                    ])),
                                    Text(
                                      '不可用',
                                      style: StylesUtils.customTextStyle(
                                        color: ColorsUtils.color7979,
                                        fontSize: StylesUtils.fontSize15,
                                      ),
                                    )
                                  ],
                                ),
                              ),
                              Container(
                                height: 45,
                                alignment: Alignment.center,
                                child: Container(
                                  padding: const EdgeInsets.symmetric(
                                      horizontal: 10),
                                  constraints: const BoxConstraints.expand(
                                      width: 315, height: 35),
                                  alignment: Alignment.centerLeft,
                                  decoration: BoxDecoration(
                                      color: HexColor(ColorsUtils.colorFafa)),
                                  child: Text(
                                    '您不是新客，您尾号为1234的手机号已下过单',
                                    softWrap: true,
                                    style: StylesUtils.customTextStyle(
                                        color: ColorsUtils.color7979,
                                        fontSize: StylesUtils.fontSize12),
                                  ),
                                ),
                              ),
                              SizedBox.fromSize(
                                size: const Size.fromHeight(45),
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text.rich(TextSpan(children: [
                                      WidgetSpan(
                                          child: Container(
                                            constraints:
                                                const BoxConstraints.expand(
                                                    width: 16, height: 16),
                                            alignment: Alignment.center,
                                            decoration: BoxDecoration(
                                                borderRadius:
                                                    BorderRadius.circular(2),
                                                gradient: LinearGradient(
                                                    colors: [
                                                      // linear-gradient(90deg, rgba(255, 110, 83, 1) 0%, rgba(255, 110, 83, 1) 0%, rgba(255, 84, 53, 1) 100%, rgba(255, 84, 53, 1) 100%)
                                                      ColorsUtils.rgba(
                                                          255, 110, 83, 1),
                                                      ColorsUtils.rgba(
                                                          255, 110, 83, 1),
                                                      ColorsUtils.rgba(
                                                          255, 84, 53, 1),
                                                      ColorsUtils.rgba(
                                                          255, 84, 53, 1)
                                                    ],
                                                    stops: const [
                                                      0,
                                                      0,
                                                      1,
                                                      1
                                                    ],
                                                    begin: Alignment.topCenter,
                                                    end: Alignment.bottomCenter,
                                                    transform: GradientRotation(
                                                        RadianUtils
                                                            .angleToRadian(
                                                                90)))),
                                            child: Text(
                                              '减',
                                              style:
                                                  StylesUtils.customTextStyle(
                                                      fontSize: StylesUtils
                                                          .fontSize11),
                                            ),
                                          ),
                                          alignment:
                                              PlaceholderAlignment.middle),
                                      TextSpan(
                                        text: ' 店铺满30减1',
                                        style: StylesUtils.customTextStyle(
                                            color: ColorsUtils.color0000,
                                            fontSize: StylesUtils.fontSize15),
                                      )
                                    ])),
                                    Text(
                                      '-￥1',
                                      style: StylesUtils.customTextStyle(
                                        color: ColorsUtils.colorFf64,
                                        fontWeight: FontWeight.w700,
                                        fontSize: StylesUtils.fontSize15,
                                      ),
                                    )
                                  ],
                                ),
                              ),
                              SizedBox.fromSize(
                                size: const Size.fromHeight(45),
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text.rich(TextSpan(children: [
                                      WidgetSpan(
                                          child: SvgUtils.assetName('u1856',
                                              width: 15, height: 16),
                                          alignment:
                                              PlaceholderAlignment.middle),
                                      TextSpan(
                                        text: ' 平台红包',
                                        style: StylesUtils.customTextStyle(
                                            color: ColorsUtils.color0000,
                                            fontSize: StylesUtils.fontSize15),
                                      )
                                    ])),
                                    Text.rich(TextSpan(children: [
                                      TextSpan(
                                        text: '1张可用 ',
                                        style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.colorFf64,
                                          fontSize: StylesUtils.fontSize15,
                                        ),
                                      ),
                                      WidgetSpan(
                                          child: Icon(
                                            CupertinoIcons.chevron_right,
                                            size: 13,
                                            color:
                                                HexColor(ColorsUtils.color9999),
                                          ),
                                          alignment:
                                              PlaceholderAlignment.middle)
                                    ]))
                                  ],
                                ),
                              ),
                              SizedBox.fromSize(
                                size: const Size.fromHeight(45),
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text.rich(TextSpan(children: [
                                      WidgetSpan(
                                          child: Container(
                                            constraints:
                                                const BoxConstraints.expand(
                                                    width: 16, height: 16),
                                            alignment: Alignment.center,
                                            decoration: BoxDecoration(
                                                borderRadius:
                                                    BorderRadius.circular(2),
                                                gradient: LinearGradient(
                                                    colors: [
                                                      // linear-gradient(90deg, rgba(255, 110, 83, 1) 0%, rgba(255, 110, 83, 1) 0%, rgba(255, 84, 53, 1) 100%, rgba(255, 84, 53, 1) 100%)
                                                      ColorsUtils.rgba(
                                                          255, 110, 83, 1),
                                                      ColorsUtils.rgba(
                                                          255, 110, 83, 1),
                                                      ColorsUtils.rgba(
                                                          255, 84, 53, 1),
                                                      ColorsUtils.rgba(
                                                          255, 84, 53, 1)
                                                    ],
                                                    stops: const [
                                                      0,
                                                      0,
                                                      1,
                                                      1
                                                    ],
                                                    begin: Alignment.topCenter,
                                                    end: Alignment.bottomCenter,
                                                    transform: GradientRotation(
                                                        RadianUtils
                                                            .angleToRadian(
                                                                90)))),
                                            child: Text(
                                              '券',
                                              style:
                                                  StylesUtils.customTextStyle(
                                                      fontSize: StylesUtils
                                                          .fontSize11),
                                            ),
                                          ),
                                          alignment:
                                              PlaceholderAlignment.middle),
                                      TextSpan(
                                        text: ' 商家代金券',
                                        style: StylesUtils.customTextStyle(
                                            color: ColorsUtils.color0000,
                                            fontSize: StylesUtils.fontSize15),
                                      )
                                    ])),
                                    Text.rich(TextSpan(children: [
                                      TextSpan(
                                        text: '-￥5',
                                        style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.colorFf64,
                                          fontWeight: FontWeight.w700,
                                          fontSize: StylesUtils.fontSize15,
                                        ),
                                      ),
                                      WidgetSpan(
                                          child: Icon(
                                            CupertinoIcons.chevron_right,
                                            size: 13,
                                            color:
                                                HexColor(ColorsUtils.color9999),
                                          ),
                                          alignment:
                                              PlaceholderAlignment.middle)
                                    ]))
                                  ],
                                ),
                              ),
                              SizedBox.fromSize(
                                size: const Size.fromHeight(45),
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text.rich(TextSpan(children: [
                                      WidgetSpan(
                                          child: Container(
                                            constraints:
                                                const BoxConstraints.expand(
                                                    width: 16, height: 16),
                                            alignment: Alignment.center,
                                            decoration: BoxDecoration(
                                                borderRadius:
                                                    BorderRadius.circular(2),
                                                gradient: LinearGradient(
                                                    colors: [
                                                      // linear-gradient(90deg, rgba(0, 102, 255, 1) 0%, rgba(0, 102, 255, 1) 0%, rgba(0, 153, 255, 1) 100%, rgba(0, 153, 255, 1) 100%)
                                                      ColorsUtils.rgba(
                                                          0, 102, 255, 1),
                                                      ColorsUtils.rgba(
                                                          0, 102, 255, 1),
                                                      ColorsUtils.rgba(
                                                          0, 153, 255, 1),
                                                      ColorsUtils.rgba(
                                                          0, 153, 255, 1)
                                                    ],
                                                    stops: const [
                                                      0,
                                                      0,
                                                      1,
                                                      1
                                                    ],
                                                    begin: Alignment.topCenter,
                                                    end: Alignment.bottomCenter,
                                                    transform: GradientRotation(
                                                        RadianUtils
                                                            .angleToRadian(
                                                                90)))),
                                            child: Text(
                                              '返',
                                              style:
                                                  StylesUtils.customTextStyle(
                                                      fontSize: StylesUtils
                                                          .fontSize11),
                                            ),
                                          ),
                                          alignment:
                                              PlaceholderAlignment.middle),
                                      TextSpan(
                                        text: ' 店铺满30返5',
                                        style: StylesUtils.customTextStyle(
                                            color: ColorsUtils.color0000,
                                            fontSize: StylesUtils.fontSize15),
                                      )
                                    ])),
                                    Text(
                                      '返￥5',
                                      style: StylesUtils.customTextStyle(
                                        color: ColorsUtils.color0000,
                                        fontSize: StylesUtils.fontSize15,
                                      ),
                                    )
                                  ],
                                ),
                              ),
                              SizedBox.fromSize(
                                size: const Size.fromHeight(45),
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text.rich(TextSpan(children: [
                                      WidgetSpan(
                                          child: Container(
                                            constraints:
                                                const BoxConstraints.expand(
                                                    width: 16, height: 16),
                                            alignment: Alignment.center,
                                            decoration: BoxDecoration(
                                                borderRadius:
                                                    BorderRadius.circular(2),
                                                gradient: LinearGradient(
                                                    colors: [
                                                      // linear-gradient(90deg, rgba(0, 102, 255, 1) 0%, rgba(0, 102, 255, 1) 0%, rgba(0, 153, 255, 1) 100%, rgba(0, 153, 255, 1) 100%)
                                                      ColorsUtils.rgba(
                                                          0, 102, 255, 1),
                                                      ColorsUtils.rgba(
                                                          0, 102, 255, 1),
                                                      ColorsUtils.rgba(
                                                          0, 153, 255, 1),
                                                      ColorsUtils.rgba(
                                                          0, 153, 255, 1)
                                                    ],
                                                    stops: const [
                                                      0,
                                                      0,
                                                      1,
                                                      1
                                                    ],
                                                    begin: Alignment.topCenter,
                                                    end: Alignment.bottomCenter,
                                                    transform: GradientRotation(
                                                        RadianUtils
                                                            .angleToRadian(
                                                                90)))),
                                            child: Text(
                                              '赠',
                                              style:
                                                  StylesUtils.customTextStyle(
                                                      fontSize: StylesUtils
                                                          .fontSize11),
                                            ),
                                          ),
                                          alignment:
                                              PlaceholderAlignment.middle),
                                      TextSpan(
                                        text: ' 店铺满30赠送苹果',
                                        style: StylesUtils.customTextStyle(
                                            color: ColorsUtils.color0000,
                                            fontSize: StylesUtils.fontSize15),
                                      )
                                    ])),
                                    Text(
                                      '1个',
                                      style: StylesUtils.customTextStyle(
                                        color: ColorsUtils.color0000,
                                        fontSize: StylesUtils.fontSize15,
                                      ),
                                    )
                                  ],
                                ),
                              ),
                              DrawUnderLine(
                                  dx: 10,
                                  dy: 2,
                                  strokeWidth: 2,
                                  child: Container(
                                    margin: const EdgeInsets.only(top: 10),
                                    height: 2,
                                  )),
                              Container(
                                height: 50,
                                alignment: Alignment.centerRight,
                                child: Text.rich(TextSpan(children: [
                                  TextSpan(
                                      text: '优惠 ',
                                      style: StylesUtils.customTextStyle(
                                        color: ColorsUtils.color0000,
                                      )),
                                  TextSpan(
                                      text: '￥6',
                                      style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.colorFf64)),
                                  TextSpan(
                                      text: '   小计 ',
                                      style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.colorFf64)),
                                  TextSpan(
                                      text: '￥35',
                                      style: StylesUtils.customTextStyle(
                                          fontSize: StylesUtils.fontSize18,
                                          fontWeight: FontWeight.w800,
                                          color: ColorsUtils.color0000))
                                ])),
                              )
                            ],
                          ),
                        ),
                      ),
                      Container(
                        margin: const EdgeInsets.only(top: 10),
                        alignment: Alignment.center,
                        child: Container(
                          width: 345,
                          decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(10),
                              color: Colors.white),
                          padding: const EdgeInsets.only(
                              top: 10, right: 15, left: 15, bottom: 10),
                          child: Column(
                            children: [
                              SizedBox.fromSize(
                                size: const Size.fromHeight(45),
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text(
                                      '备注',
                                      style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.color0000,
                                          fontSize: StylesUtils.fontSize15),
                                    ),
                                    Text.rich(TextSpan(children: [
                                      TextSpan(
                                        text: '口味、偏好等要求',
                                        style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.color9999,
                                          fontSize: StylesUtils.fontSize15,
                                        ),
                                      ),
                                      WidgetSpan(
                                          child: Icon(
                                            CupertinoIcons.chevron_right,
                                            size: 13,
                                            color:
                                                HexColor(ColorsUtils.color9999),
                                          ),
                                          alignment:
                                              PlaceholderAlignment.middle)
                                    ])),
                                  ],
                                ),
                              ),
                              SizedBox.fromSize(
                                size: const Size.fromHeight(45),
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text(
                                      '餐具数量',
                                      style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.color0000,
                                          fontSize: StylesUtils.fontSize15),
                                    ),
                                    Text.rich(TextSpan(children: [
                                      TextSpan(
                                        text: '未选择',
                                        style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.color9999,
                                          fontSize: StylesUtils.fontSize15,
                                        ),
                                      ),
                                      WidgetSpan(
                                          child: Icon(
                                            CupertinoIcons.chevron_right,
                                            size: 13,
                                            color:
                                                HexColor(ColorsUtils.color9999),
                                          ),
                                          alignment:
                                              PlaceholderAlignment.middle)
                                    ])),
                                  ],
                                ),
                              ),
                              SizedBox.fromSize(
                                size: const Size.fromHeight(45),
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text(
                                      '发票',
                                      style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.color0000,
                                          fontSize: StylesUtils.fontSize15),
                                    ),
                                    Text.rich(TextSpan(children: [
                                      TextSpan(
                                        text: '未选择',
                                        style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.color9999,
                                          fontSize: StylesUtils.fontSize15,
                                        ),
                                      ),
                                      WidgetSpan(
                                          child: Icon(
                                            CupertinoIcons.chevron_right,
                                            size: 13,
                                            color:
                                                HexColor(ColorsUtils.color9999),
                                          ),
                                          alignment:
                                              PlaceholderAlignment.middle)
                                    ])),
                                  ],
                                ),
                              ),
                            ],
                          ),
                        ),
                      ),
                      const SizedBox(
                        height: 100,
                      ),
                    ]),
                  ),
                ),
              ],
            ),
          ),
          Positioned(
            width: 345,
            height: 50,
            left: (Get.width - 345) / 2,
            bottom: 20,
            child: Row(
              children: [
                Expanded(
                    child: Container(
                  height: 50,
                  padding: const EdgeInsets.symmetric(horizontal: 15),
                  decoration: BoxDecoration(
                      color: HexColor(ColorsUtils.color3333),
                      borderRadius: const BorderRadius.only(
                          topLeft: Radius.circular(25),
                          bottomLeft: Radius.circular(25))),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Text(
                        '已优惠 ￥6',
                        style: StylesUtils.customTextStyle(
                            color: ColorsUtils.colorCccc,
                            fontSize: StylesUtils.fontSize13),
                      ),
                      Text.rich(TextSpan(children: [
                        TextSpan(
                            text: '应付',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize13,
                            )),
                        TextSpan(
                            text: ' ￥35',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize18,
                              fontWeight: FontWeight.w700,
                            )),
                      ]))
                    ],
                  ),
                )),
                Container(
                  constraints:
                      const BoxConstraints.expand(width: 110, height: 50),
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                      borderRadius: const BorderRadius.only(
                          topRight: Radius.circular(25),
                          bottomRight: Radius.circular(25)),
                      gradient: LinearGradient(
                          colors: [
                            ColorsUtils.rgba(255, 153, 0, 1),
                            ColorsUtils.rgba(255, 153, 0, 1),
                            ColorsUtils.rgba(254, 70, 1, 1),
                            ColorsUtils.rgba(254, 70, 1, 1),
                          ],
                          stops: const [
                            0,
                            0,
                            1,
                            1
                          ],
                          begin: Alignment.centerLeft,
                          end: Alignment.centerRight,
                          transform:
                              GradientRotation(RadianUtils.angleToRadian(90)))),
                  child: GestureDetector(
                    onTap: submitOrder,
                    child: Text(
                      '提交订单',
                      style: StylesUtils.customTextStyle(
                          fontSize: StylesUtils.fontSize15),
                    ),
                  ),
                )
              ],
            ),
          )
        ],
      ),
    );
  }

  String get timerText {
    int minutes = controller.second.value ~/ 60;
    int seconds = controller.second.value % 60;
    return '${minutes.toString().padLeft(2, '0')}:${seconds.toString().padLeft(2, '0')}';
  }

  String get formatSeconds {
    final duration = Duration(seconds: controller.second.value);
    String twoDigits(int n) => n.toString().padLeft(2, '0');
    return '${twoDigits(duration.inMinutes)}:${twoDigits(duration.inMinutes * 60 - duration.inSeconds)}';
  }

  void submitOrder() {
    Get.bottomSheet(
        Container(
          height: 530,
          decoration: BoxDecoration(
              color: ColorsUtils.rgba(247, 247, 247, 1),
              borderRadius: const BorderRadius.only(
                  topLeft: Radius.circular(15), topRight: Radius.circular(15))),
          child: Column(
            children: [
              Stack(
                children: [
                  Container(
                    padding: const EdgeInsets.only(
                        top: 15, right: 2, left: 2, bottom: 2),
                    alignment: Alignment.center,
                    child: Obx(() => Text.rich(TextSpan(children: [
                          TextSpan(
                              text: '请在 ',
                              style: StylesUtils.customTextStyle(
                                fontSize: StylesUtils.fontSize16,
                                color: ColorsUtils.color0000,
                                fontWeight: FontWeight.w700,
                              )),
                          TextSpan(
                              text: timerText,
                              style: StylesUtils.customTextStyle(
                                  fontSize: StylesUtils.fontSize16,
                                  color: ColorsUtils.colorFf00,
                                  fontWeight: FontWeight.w700)),
                          TextSpan(
                              text: ' 内支付',
                              style: StylesUtils.customTextStyle(
                                fontSize: StylesUtils.fontSize16,
                                color: ColorsUtils.color0000,
                                fontWeight: FontWeight.w700,
                              )),
                        ]))),
                  ),
                  Positioned(
                      top: 15,
                      left: 20,
                      child: GestureDetector(
                          onTap: Get.back,
                          child: Icon(
                            CupertinoIcons.xmark,
                            size: 20,
                            color: HexColor(ColorsUtils.color6666),
                          )))
                ],
              ),
              Container(
                height: 90,
                padding: const EdgeInsets.only(
                    top: 15, bottom: 15, left: 15, right: 2),
                margin: EdgeInsets.only(
                    top: 20,
                    left: (Get.width - 345) / 2,
                    right: (Get.width - 345) / 2),
                decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(8)),
                child: Column(
                  children: [
                    Align(
                      alignment: Alignment.centerLeft,
                      child: Text(
                        '李四收  136****5678',
                        style: StylesUtils.customTextStyle(
                            color: ColorsUtils.color6666),
                      ),
                    ),
                    Container(
                      margin: const EdgeInsets.only(top: 10),
                      alignment: Alignment.centerLeft,
                      child: Text(
                        '北海市海城区北海大道96号龙岭花园12栋',
                        style: StylesUtils.customTextStyle(
                            fontSize: StylesUtils.fontSize16,
                            color: ColorsUtils.color0000),
                      ),
                    )
                  ],
                ),
              ),
              Container(
                margin: EdgeInsets.only(
                    top: 10,
                    left: (Get.width - 345) / 2,
                    right: (Get.width - 345) / 2),
                decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(8)),
                child: Column(
                  children: [
                    Container(
                      padding: const EdgeInsets.only(
                          top: 15, right: 2, left: 15, bottom: 12),
                      alignment: Alignment.centerLeft,
                      child: Text(
                        '选择支付方式',
                        style: StylesUtils.customTextStyle(
                            color: ColorsUtils.color6666),
                      ),
                    ),
                    DrawTopLine(
                      dx: 5,
                      child: Container(
                        height: 60,
                        padding: const EdgeInsets.symmetric(horizontal: 15),
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Wrap(
                              spacing: 15,
                              crossAxisAlignment: WrapCrossAlignment.center,
                              alignment: WrapAlignment.start,
                              children: [
                                SvgUtils.assetName('u4837',
                                    width: 28, height: 28),
                                Text(
                                  '支付宝',
                                  style: StylesUtils.customTextStyle(
                                      fontSize: StylesUtils.fontSize16,
                                      color: ColorsUtils.color0000),
                                )
                              ],
                            ),
                            Obx(() => GestureDetector(
                                  onTap: () {
                                    controller.typeIndex.value = 0;
                                  },
                                  child: controller.typeIndex.value == 0
                                      ? Icon(
                                          CupertinoIcons.checkmark_circle_fill,
                                          size: 22,
                                          color:
                                              HexColor(ColorsUtils.colorFf64),
                                        )
                                      : Icon(
                                          CupertinoIcons.circle,
                                          size: 22,
                                          color:
                                              HexColor(ColorsUtils.colorCccc),
                                        ),
                                )),
                          ],
                        ),
                      ),
                    ),
                    DrawTopLine(
                      dx: 5,
                      child: Container(
                        height: 60,
                        padding: const EdgeInsets.symmetric(horizontal: 15),
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Wrap(
                              spacing: 15,
                              crossAxisAlignment: WrapCrossAlignment.center,
                              alignment: WrapAlignment.start,
                              children: [
                                SvgUtils.assetName('u4838',
                                    width: 30, height: 25),
                                Text(
                                  '微信支付',
                                  style: StylesUtils.customTextStyle(
                                      fontSize: StylesUtils.fontSize16,
                                      color: ColorsUtils.color0000),
                                )
                              ],
                            ),
                            Obx(() => GestureDetector(
                                  onTap: () {
                                    controller.typeIndex.value = 1;
                                  },
                                  child: controller.typeIndex.value == 1
                                      ? Icon(
                                          CupertinoIcons.checkmark_circle_fill,
                                          size: 22,
                                          color:
                                              HexColor(ColorsUtils.colorFf64),
                                        )
                                      : Icon(
                                          CupertinoIcons.circle,
                                          size: 22,
                                          color:
                                              HexColor(ColorsUtils.colorCccc),
                                        ),
                                )),
                          ],
                        ),
                      ),
                    ),
                    DrawTopLine(
                      dx: 5,
                      child: Container(
                        height: 60,
                        padding: const EdgeInsets.symmetric(horizontal: 15),
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Wrap(
                              spacing: 15,
                              crossAxisAlignment: WrapCrossAlignment.center,
                              alignment: WrapAlignment.start,
                              children: [
                                SvgUtils.assetName('u4840',
                                    width: 29, height: 30),
                                Text(
                                  '建行龙支付',
                                  style: StylesUtils.customTextStyle(
                                      fontSize: StylesUtils.fontSize16,
                                      color: ColorsUtils.color0000),
                                )
                              ],
                            ),
                            Obx(() => GestureDetector(
                                  onTap: () {
                                    controller.typeIndex.value = 2;
                                  },
                                  child: controller.typeIndex.value == 2
                                      ? Icon(
                                          CupertinoIcons.checkmark_circle_fill,
                                          size: 22,
                                          color:
                                              HexColor(ColorsUtils.colorFf64),
                                        )
                                      : Icon(
                                          CupertinoIcons.circle,
                                          size: 22,
                                          color:
                                              HexColor(ColorsUtils.colorCccc),
                                        ),
                                )),
                          ],
                        ),
                      ),
                    ),
                    DrawTopLine(
                        dx: 5,
                        child: Container(
                          height: 60,
                          padding: const EdgeInsets.symmetric(horizontal: 15),
                          child: Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            children: [
                              Wrap(
                                spacing: 15,
                                crossAxisAlignment: WrapCrossAlignment.center,
                                alignment: WrapAlignment.start,
                                children: [
                                  SvgUtils.assetName('u4839',
                                      width: 30, height: 30),
                                  Text(
                                    '招商银行一网通',
                                    style: StylesUtils.customTextStyle(
                                        fontSize: StylesUtils.fontSize16,
                                        color: ColorsUtils.color0000),
                                  )
                                ],
                              ),
                              Obx(() => GestureDetector(
                                    onTap: () {
                                      controller.typeIndex.value = 3;
                                    },
                                    child: controller.typeIndex.value == 3
                                        ? Icon(
                                            CupertinoIcons
                                                .checkmark_circle_fill,
                                            size: 22,
                                            color:
                                                HexColor(ColorsUtils.colorFf64),
                                          )
                                        : Icon(
                                            CupertinoIcons.circle,
                                            size: 22,
                                            color:
                                                HexColor(ColorsUtils.colorCccc),
                                          ),
                                  )),
                            ],
                          ),
                        )),
                  ],
                ),
              ),
              Container(
                margin: const EdgeInsets.only(top: 20),
                alignment: Alignment.center,
                child: Container(
                  constraints:
                      const BoxConstraints.expand(width: 315, height: 45),
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(23),
                      gradient: LinearGradient(
                          colors: [
                            ///linear-gradient(90deg, rgba(255, 153, 0, 1) 0%, rgba(255, 153, 0, 1) 0%, rgba(254, 70, 1, 1) 100%, rgba(254, 70, 1, 1) 100%)
                            ColorsUtils.rgba(255, 153, 0, 1),
                            ColorsUtils.rgba(255, 153, 0, 1),
                            ColorsUtils.rgba(254, 70, 1, 1),
                            ColorsUtils.rgba(254, 70, 1, 1)
                          ],
                          stops: const [
                            0,
                            0,
                            1,
                            1
                          ],
                          transform:
                              GradientRotation(RadianUtils.angleToRadian(90)))),
                  child: GestureDetector(
                    onTap: () {
                      Get.back();
                      Get.engine.addPostFrameCallback((_) {
                        Get.toNamed(Routes.orderPaymentSuccess);
                      });
                    },
                    child: Text(
                      '继续结算 ￥104',
                      style: StylesUtils.customTextStyle(
                          fontSize: StylesUtils.fontSize16),
                    ),
                  ),
                ),
              )
            ],
          ),
        ),
        barrierColor: ColorsUtils.rgba(0, 0, 0, 0.298039215686275),
        isScrollControlled: true,
        elevation: 0);
  }

  Widget get change {
    if (controller.isSelected.isTrue) {
      return Container(
        decoration: const BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.only(
                bottomLeft: Radius.circular(10),
                bottomRight: Radius.circular(10))),
        child: Column(
          children: [
            Container(
              padding: const EdgeInsets.only(left: 10, right: 10, top: 15),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.start,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Expanded(
                      child: Container(
                    padding: const EdgeInsets.only(right: 10),
                    alignment: Alignment.centerLeft,
                    child: Text.rich(TextSpan(children: [
                      WidgetSpan(
                          child: Container(
                            constraints: const BoxConstraints.expand(
                                width: 30, height: 16),
                            decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(2),
                              //linear-gradient(90deg, rgba(255, 110, 83, 1) 0%, rgba(255, 110, 83, 1) 0%, rgba(255, 84, 53, 1) 100%, rgba(255, 84, 53, 1) 100%)
                              gradient: LinearGradient(
                                colors: [
                                  ColorsUtils.rgba(255, 110, 83, 1),
                                  ColorsUtils.rgba(255, 110, 83, 1),
                                  ColorsUtils.rgba(255, 84, 53, 1),
                                  ColorsUtils.rgba(255, 84, 53, 1),
                                ],
                                stops: const [0, 0, 1, 1],
                                transform: GradientRotation(
                                  RadianUtils.angleToRadian(90),
                                ),
                              ),
                            ),
                            alignment: Alignment.center,
                            child: Text(
                              '公司',
                              softWrap: true,
                              style: StylesUtils.customTextStyle(
                                  fontSize: StylesUtils.fontSize12),
                            ),
                          ),
                          alignment: PlaceholderAlignment.middle),
                      TextSpan(
                          text: '  北海市海城区北海大道东方银座大厦C座',
                          style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize18,
                              fontWeight: FontWeight.w700,
                              lineHeight: 1.4,
                              color: ColorsUtils.color0000))
                    ])),
                  )),
                  GestureDetector(
                      onTap: () {},
                      child: Container(
                        margin: const EdgeInsets.only(top: 5),
                        alignment: Alignment.centerLeft,
                        child: Icon(
                          CupertinoIcons.chevron_forward,
                          size: 15,
                          color: HexColor(ColorsUtils.color9999),
                        ),
                      ))
                ],
              ),
            ),
            Container(
              alignment: Alignment.centerLeft,
              padding: const EdgeInsets.only(top: 10, bottom: 25, left: 10),
              child: Text(
                '王先生    +8613612345678',
                softWrap: true,
                style:
                    StylesUtils.customTextStyle(color: ColorsUtils.color0000),
              ),
            ),
            DrawUnderLine(
                dx: 10,
                dy: 10,
                child: Container(
                  height: 2,
                )),
            Expanded(
                child: Padding(
              padding: const EdgeInsets.only(left: 10, right: 10, bottom: 10),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text(
                    '送达时间',
                    style: StylesUtils.customTextStyle(
                        fontSize: StylesUtils.fontSize15,
                        color: ColorsUtils.color0000),
                  ),
                  Text.rich(TextSpan(children: [
                    TextSpan(
                      text: '大约17:15送达 ',
                      style: StylesUtils.customTextStyle(
                          fontSize: StylesUtils.fontSize15,
                          color: ColorsUtils.colorFf64),
                    ),
                    WidgetSpan(
                        child: Icon(
                          CupertinoIcons.chevron_forward,
                          size: 15,
                          color: HexColor(ColorsUtils.color9999),
                        ),
                        alignment: PlaceholderAlignment.middle)
                  ]))
                ],
              ),
            ))
          ],
        ),
      );
    }
    return Container(
      padding: const EdgeInsets.only(left: 10, right: 10, top: 15),
      decoration: const BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.only(
              bottomLeft: Radius.circular(10),
              bottomRight: Radius.circular(10))),
      child: Column(
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.start,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Expanded(
                  child: Container(
                padding: const EdgeInsets.only(right: 10),
                alignment: Alignment.topLeft,
                child: Text(
                  '北海市海城区北海大道凤凰树广场A座一楼234号',
                  style: StylesUtils.customTextStyle(
                      fontSize: StylesUtils.fontSize18,
                      fontWeight: FontWeight.w700,
                      color: ColorsUtils.color0000,
                      lineHeight: 1.4),
                ),
              )),
              Stack(
                children: [
                  ClipRRect(
                    borderRadius: BorderRadius.circular(5),
                    child: Image.network(
                      'https://img1.baidu.com/it/u=1918325584,1030790085&fm=253&fmt=auto&app=138&f=PNG?w=456&h=285',
                      width: 100,
                      height: 80,
                    ),
                  ),
                  Positioned.fill(
                      child: Center(
                    child: Container(
                      constraints:
                          const BoxConstraints.expand(width: 75, height: 18),
                      decoration: BoxDecoration(
                        color: Colors.white,
                        borderRadius: BorderRadius.circular(9),
                      ),
                      alignment: Alignment.center,
                      child: Text(
                        '距您2.1km',
                        style: StylesUtils.customTextStyle(
                            fontSize: StylesUtils.fontSize12,
                            color: ColorsUtils.color0000),
                      ),
                    ),
                  ))
                ],
              )
            ],
          ),
          Row(
            mainAxisAlignment: MainAxisAlignment.start,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Column(
                children: [
                  Align(
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '自取时间',
                      softWrap: true,
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color9999,
                          fontSize: StylesUtils.fontSize13),
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(top: 10),
                    alignment: Alignment.centerLeft,
                    child: Text.rich(TextSpan(children: [
                      TextSpan(
                          text: '17:30 ',
                          style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize15,
                              fontWeight: FontWeight.w700,
                              color: ColorsUtils.color0000)),
                      WidgetSpan(
                          child: Icon(
                            CupertinoIcons.chevron_forward,
                            size: 14,
                            color: HexColor(ColorsUtils.color9999),
                          ),
                          alignment: PlaceholderAlignment.middle)
                    ])),
                  )
                ],
              ),
              Container(
                margin: const EdgeInsets.symmetric(horizontal: 15),
                child: DottedBorder(
                  strokeWidth: 2,
                  color: HexColor(ColorsUtils.colorF5f5),
                  padding: EdgeInsets.zero,
                  dashPattern: const [8, 4],
                  child: Container(
                    constraints:
                        const BoxConstraints.expand(width: 2, height: 46),
                  ),
                ),
              ),
              Expanded(
                  child: Column(
                children: [
                  Align(
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '预留手机',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color9999,
                          fontSize: StylesUtils.fontSize13),
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(top: 10),
                    alignment: Alignment.centerLeft,
                    child: Text.rich(TextSpan(children: [
                      TextSpan(
                          text: '+86 ',
                          style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize15,
                              color: ColorsUtils.color0000,
                              fontWeight: FontWeight.w700)),
                      WidgetSpan(
                          child: Icon(
                            CupertinoIcons.chevron_down,
                            size: 10,
                            color: HexColor(ColorsUtils.color9999),
                          ),
                          alignment: PlaceholderAlignment.middle),
                      TextSpan(
                          text: ' 13612345678 ',
                          style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize15,
                              color: ColorsUtils.color0000,
                              fontWeight: FontWeight.w700)),
                      WidgetSpan(
                          child: SvgUtils.assetName('u2051',
                              width: 14, height: 13),
                          alignment: PlaceholderAlignment.middle),
                    ])),
                  )
                ],
              ))
            ],
          ),
          Container(
              margin: const EdgeInsets.only(top: 15),
              alignment: Alignment.centerLeft,
              child: Obx(() => GestureDetector(
                    onTap: () {
                      controller.isAgree.value = !controller.isAgree.value;
                    },
                    child: Text.rich(TextSpan(children: [
                      controller.isAgree.isTrue
                          ? WidgetSpan(
                              child: Icon(
                                CupertinoIcons.checkmark_alt_circle_fill,
                                size: 16,
                                color: HexColor(ColorsUtils.colorFf64),
                              ),
                              alignment: PlaceholderAlignment.middle)
                          : WidgetSpan(
                              child: Icon(
                                CupertinoIcons.circle,
                                size: 16,
                                color: HexColor(ColorsUtils.color9999),
                              ),
                              alignment: PlaceholderAlignment.middle),
                      TextSpan(
                          text: ' 我已阅读并同意签署 ',
                          style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              color: ColorsUtils.color9999)),
                      TextSpan(
                          text: '小默到店自取服务协议',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.colorFf6e,
                              fontSize: StylesUtils.fontSize12))
                    ])),
                  )))
        ],
      ),
    );
  }
}
